#include "Sort.h"


void TestSelectSort()
{
	//int a[] = { 1,5,3,4,2,7,7,9,7};

	//int a[] = { 7,1,2 };
	//int a[] = { 9,1,2,4,4,4,7,7,1,1,2,4,0,8,2,22 };
	int a[] = { 1,3,3,2,2,1,5,5,5,4,4,9,9,8,8,6,6,7 };


	SelectSort(a, sizeof(a) / sizeof(int));

	PrintArray(a, sizeof(a) / sizeof(int));
}


void TestBubbleSort()
{
	//int a[] = { 1,5,3,4,2,7,7,9,7};

	//int a[] = { 7,1,2 };
	//int a[] = { 9,1,2,4,4,4,7,7,1,1,2,4,0,8,2,22 };
	int a[] = { 1,3,3,2,2,1,5,5,5,4,4,9,9,8,8,6,6,7 };


	BubbleSort(a, sizeof(a) / sizeof(int));

	PrintArray(a, sizeof(a) / sizeof(int));
}


//void TestQuickSort()
//{
//	//int a[] = { 1,3,3,2,2,1,5,5,5,4,4,9,9,8,8,6,6,7 };
//
//	int a[] = { 7,1,2 };
//
//	//int a[] = { 1,2,3,3,2,1,1,1 };
//
//	//int a[] = { 1,1,1,3,3,3,2,2,2,4,6,5,5,6,4,4,5,6};
//
//	QuickSort(a, 0, sizeof(a) / sizeof(int) - 1);
//
//	PrintArray(a, sizeof(a) / sizeof(int));
//}


void TestQuickSortNoR()
{
	//int a[] = { 1,3,2 };
	  int a[] = { 1,1,1,3,3,3,2,2,2,4,6,5,5,6,4,4,5,6 };

	QuickSortNoR(a, 0, sizeof(a) / sizeof(int) - 1);

	PrintArray(a, sizeof(a) / sizeof(int));

}

void TestMergeSort()
{
	//int a[] = { 1,4,3,2 };
	int a[] = { 1,1,1,3,3,3,2,2,2,4,6,5,5,6,4,4,5,6 };

	MergeSort(a, sizeof(a) / sizeof(int));

	PrintArray(a, sizeof(a) / sizeof(int));

}


void TestMergeSortNonR()
{
	//int a[] = { 1,4,3,2 };
	int a[] = { 1,1,1,3,3,3,2,2,2,4,6,5,5,6,4,4,5,6 };

	MergeSortNoR(a, sizeof(a) / sizeof(int));

	PrintArray(a, sizeof(a) / sizeof(int));

}



int main()
{

	//TestSelectSort();

	//TestBubbleSort();

	//TestQuickSort();
	
	/*TestQuickSortNoR();*/

	TestMergeSortNonR();

	return 0;
}